Ext.define('Demo.view.finance.advancePanel',{
	extend: 'Ext.panel.Panel',
	alias: 'widget.advancePanel',
	items: [
	        {
	        	xtype: 'advanceBar',
	        	id: "advanceTop",
	        	store: Ext.create("Demo.store.finance.advanceStore",{})
	        },
	        {
	        	xtype:"form",
	        	layout:'column',
	        	items:[
	        	       {
							 style:"margin:10px 20px 10px 40px",
		        	    	 xtype: 'testText1',
					    	 name: 'customNo',
							 fieldLabel: '客户',
							 width:250,
	        	       },
					   {		
							 style: 'margin:10px 20px 10px 60px;',
							 xtype: 'datefield',
							 name: 'advanceDate',
							 bodyPadding: 5,
							 fieldLabel: '单据日期',
							 width: 250,
							 labelWidth: 80,
							 format:'Y-m-d', 
							 value: new Date()
					   },
					   {     style:'margin:10px 20px 10px 20px;',
						   	 xtype: 'testText1',
							 name: 'advanceNo',
							 fieldLabel: '单据号码',
							 width: 250,
							 labelWidth: 90,
					   },
					   {
						     style:'margin:0px 0px 10px 40px;',
						     xtype: 'testText1',
							 name: 'cachStyleID',
							 fieldLabel: '结算方式一',
							 width: 160,
					   },
					   {	
						   	 style:"margin-buttom:10px;",
						     xtype: 'testText1',
							 name: 'cashPrice',
							 width: 90,
					   },
					   {
						     style:"margin:0px 0px 10px 80px;",
						     xtype: 'testText1',
							 name: 'rate',
							 fieldLabel: '汇率',
							 value: '1.0000',
							 width:250,
							 labelWidth: 80,
					   },
					   {
						     style:"margin:0px 0px 10px 40px;",
						     xtype: 'testText1',
							 name: 'currencyName',
							 fieldLabel: '币别',
							 value: 'RMB',
							 width: 250,
							 labelWidth: 90,
					   },
					   {
						     style:'margin-left:40px;',
						     xtype: 'testText1',
							 name: 'visaStylyID',
							 fieldLabel: '结算方式二',
							 width: 160,
					   },
					   {	
						   	 xtype: 'testText1',
							 name: 'visaPrice',
							 width: 90,
							 style:"margin:0px;"
					   },
					   {
						   	 style:"margin-left:80px;",
						     xtype: 'testText1',
							 name: 'vocherNo',
							 fieldLabel: '凭证编号',
							 width:250,
							 labelWidth: 80,
					   },
					   {
						   	 style:"margin-left:40px;",
						     xtype: 'testText1',
							 name: '',
							 fieldLabel: '应收冲款类型',
							 width:250,
							 labelWidth: 90,
							 value:"预收款"
					   },
					   {
						     style:'margin:10px 0px 10px 40px;',
						     xtype: 'testText1',
							 name: 'otherPayStyleID',
							 fieldLabel: '结算方式三',
							 width: 160,
					   },
					   {	
						   	 style:"margin-top:10px;",
						     xtype: 'testText1',
							 name: 'otherPayPrice',
							 width: 90,
					   },
					   {
						   	 style:"margin:10px 0px 0px 80px;",
						     xtype: 'testText1',
							 name: '',
							 fieldLabel: '折扣率(%)',
							 width:250,
							 labelWidth: 80,
					   },{
							 xtype: 'testText1',
							 id: 'autidStatus',
							 fieldLabel: '审核状态',
							 width:250,
							 style:"margin:10px 20px 10px 5px;display:none;"
					   },
					   {
						   	 style:"margin:10px 0px 0px 40px;",
						     xtype: 'datefield',
							 name: '',
							 fieldLabel: '终止帐月',
							 width:250,
							 labelWidth: 90,
					   },/*{
							  xtype:"box",
							  width:118,
							  name:"img",
							  id:"img",
							  style:"display:none;",
							  autoEl:{
								  tag:"img",
								  src:"../../images/bgi/shenhe.png"
							  }
						  },*/{
							xtype: 'tabpanel',
						    width: 950,
							height: 230,
							style: 'margin:10px 0px 0px 40px',
							items: [
							        {
							        	title:'内容',
							        	items:[
											   { 
												   xtype: 'panel',
												   width: 2000,
												   items:[
												          {
												        	  xtype: 'grid',
												        	  store: Ext.create('Ext.data.Store',{
												        		  fields:[{
												        				name:"advanceNo",type:"string"
												        			},{
												        				name:"lineId",type:"int"
												        			},{
												        				name:"sourceType",type:"string"
												        			},{
												        				name:"sourceOrder",type:"string"
												        			},{
												        				name:"remark",type:"string"
												        			},{
												        				name:"advancePrice",type:"double"
												        			}]
												        	  }),
												        	  height: 160,
												        	  columns: [
												        	            {header: '（栏号）', dataIndex: 'lineId', width: 50, editor:"textfield"},
												        		        {header: '预收金额', dataIndex: 'advancePrice', width: 100 ,editor:"textfield"},
												        		       	{header: '来源单别', dataIndex: 'sourceType', width: 120,editor:"textfield" },
												        		       	{header: '来源单号', dataIndex: 'sourceOrder' ,editor:"textfield"},
												        				{header: '摘要', dataIndex: 'remark' ,editor:"textfield"},
												        			   ],
												        	  plugins: [  
												        	            Ext.create('Ext.grid.plugin.CellEditing',{  
												        					clicksToEdit:1 //设置单击单元格编辑  
												        				})  
												        			   ],  
												        	  listeners:{
												        				 //双击行事件  
												        		  itemdblclick:function(dataview, record, item, index, e){
												        			  alert('itemdblclick');
												        			  var data  = {  
												        			  };
												        			  //添加一行表格
												        			  this.getStore().add(data);
												        		}
												        	  }
												          	}
												          ],
												   bbar:[
												         {xtype:"label",text:'总计:',width:90},
												         {xtype:"textfield",disabled:true,width:90,margin:'0 5',value:'0.00'},
												        ]
											    }
							        	      ]
							        },
							        {title:'备注'}
							       ],
					   }
					   ,{
						   xtyle: 'form',
						   store: ['finance.advanceStore'],
						   layout: 'column',
						   baseCls: 'x-plain',
						   items:[
								  {
									 xtype: 'testText1',
									 name: 'makerSign',
									 fieldLabel: '制单人员',
									 width:250,
									 style:"margin:10px 20px 10px 5px"
								  },
								  {
									 xtype: 'testText1',
									 name: 'dept.departNo',
									 fieldLabel: '所属部门',
									 width:250,
									 style:"margin:10px 20px 10px 0px"
								  },
								  {
									 xtype: 'testText1',
									 name: 'permitterSign',
									 fieldLabel: '复核人员',
									 width:250,
									 style:"margin:10px 20px 10px 0px"
								  },
								  {
									 xtype: 'testText1',
									 name: 'projectFrom',
									 fieldLabel: '所属项目',
									 width:250,
									 style:"margin:10px 20px 10px 0px"
								  }
						         ]
					   	}
					  ]
	        }
	      ]
});